<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
  <head>
    
    <title>转账</title>
	<script type="text/javascript" src = "js/jquery.js"></script>
	<style type="text/css">
		span{
			color:red;
		}
	</style>
  </head>
  
  <body>
  <h3>请输入对方账号：</h3>
  <%
  	String code = request.getParameter("p");
  	if("re".equals(code)){
   %>
   <div style = "color:red;">此用户不存在，请核实：</div>
   <%}else if("lack".equals(code)){ %>
   <div style="color:red;">账户金额不足</div>
   <%}else if("1001".equals(code)){ %>
   	<div style="color:red;">更新操作失败</div>
   <%} %>
  <form action="account.jspx?p=tran" method = "post" id = "myform">
  		账户：<input type = "text" name = "account" id = "acc"/><span id = "acc_error"></span><br/>
  		金额：<input type = "text" name = "money" id = "money"/><span id = "money_error"></span><br/>
  		<input type = "button" value = "提交" id = "btn"/>
  </form>
  
  <script type="text/javascript">
  	$(document).ready(function(){
	  	
	  	 $("#acc").keydown(function(){
	  		$("#acc_error").html("");
	  	});
	  	$("#money").keydown(function(){
	  		$("#money_error").html("");
	  	});
  		$("#btn").click(function(){
  			
  			var acc = $("#acc").val();
  			var money = $("#money").val();
  			if(acc.trim()== null||acc.trim()=="" ){
  				$("#acc").focus();
  				$("#acc_error").html("请输入对方账户：");
  				return ;
  			}
  			if(money <=0 ){
  				$("#money").focus();
  				$("#money_error").html("请输入正确金额：");
  				return ;
  			}
  			
  			$("#myform").submit();
  		});
  	});
  </script>
  </body>
</html>
